package vo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;

@Entity
public class Base implements Serializable{
	@Id
	@GenericGenerator(strategy="uuid",name="myUuid")
	@GeneratedValue(generator="myUuid")
	private String id;
	private String bname;
	private String location;
	@JsonBackReference
	@OneToMany(mappedBy="base",cascade=CascadeType.REMOVE)
	private Set<Product> products=new HashSet<Product>();
	public Base() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Base(String id, String bname, String location, Set<Product> products) {
		super();
		this.id = id;
		this.bname = bname;
		this.location = location;
		this.products = products;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getBname() {
		return bname;
	}
	public void setBname(String bname) {
		this.bname = bname;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public Set<Product> getProducts() {
		return products;
	}
	public void setProducts(Set<Product> products) {
		this.products = products;
	}
	
	
	
}
